<?php
session_start();

if(dirname($_SERVER['PHP_SELF'])=="\\"){
	define ("ROOT_PATH","");
}else{
	define("ROOT_PATH",dirname($_SERVER['PHP_SELF']));
}

include ("conn.php");
//lay ngon ngu
$lang = (isset($_SESSION["lang"]))?$_SESSION["lang"]:0;
// lay router tu rewrite url
if(isset($_GET["rt"])){
	$rt = $_GET["rt"];
}else{
	$rt = "";
}

$parts = explode("/",$rt);
if($parts[0]=="" || $parts[0]=="home"){
	include "home.php";
}else if($parts[0]=="view"&& $parts[1]=="s"){
	if(isset($parts[2]) && is_numeric($parts[2])){
			$section_id = $parts[2];
			$page  = isset($_GET["page"])?$_GET["page"]:1;
			//echo "sid=".$section_id." aid=".$article_id;
			include "view.php";
	}		

		
	
	
	
}else if($parts[0]=="view"&& is_numeric($parts[1])){
	if(!isset($parts[2])){
		$section_id = -1;
		$article_id  = $parts[1];
		//echo "sid=".$section_id." aid=".$article_id;
		
		include "view.php";
	}
	
}

?>